//
//  YZCommunityAddFriendVC.m
//  VET
//
//  Created by YZ on 2018/7/18.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZCommunityAddFriendVC.h"
#import "YZCommunityWebViewModel.h"

@interface YZCommunityAddFriendVC ()

@property (nonatomic, strong) YZCommunityWebViewModel *viewModel;

@end

@implementation YZCommunityAddFriendVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor blackColor]}];
    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
}

#pragma  mark -- override

- (void)customUserContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
{
}

- (void)customWebView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
{
    [self.viewModel doActionWithMessage:message currentController:self];
    completionHandler();
}

- (void)customWwebView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
{
    decisionHandler(WKNavigationActionPolicyAllow);
}

#pragma mark -- setters && getters

- (YZCommunityWebViewModel *)viewModel
{
    if (!_viewModel) {
        _viewModel = [[YZCommunityWebViewModel alloc] init];
    }
    return _viewModel;
}

@end
